include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=gobinet
PKG_RELEASE:=2

include $(INCLUDE_DIR)/package.mk

define KernelPackage/gobinet
  SUBMENU:=Othermodules
  TITLE:=gobinet
  DEPENDS:=+kmod-usb-core
  FILES:=$(PKG_BUILD_DIR)/gobinet.ko
	AUTOLOAD:=$(call AutoLoad,81,gobinet) #内核自动挂载
  KCONFIG:=
endef

define KernelPackage/gobinet/description
  Kernel module for register acustom gobinet platform device.
endef

EXTRA_CFLAGS:= -DSIMCOM_NETWORK_MANAGER

MAKE_OPTS:= \
	ARCH="$(LINUX_KARCH)" \
	CROSS_COMPILE="$(TARGET_CROSS)" \
	SUBDIRS="$(PKG_BUILD_DIR)"

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

define Build/Compile
	$(MAKE) -C "$(LINUX_DIR)" \
	$(MAKE_OPTS) modules
endef

$(eval $(call KernelPackage,gobinet))
